package My

import (
	"context"
	"db2s/global"
	"db2s/parDef"
	"db2s/ref"
)

func (Go GolF) Position(ctx context.Context) (result global.Return, err error) {
	//var event = "[Position]"
	//var execSql = []string{fmt.Sprintf("show master status;")}
	//switch parameter.Options.Scn {
	//case "auto":
	//	if parameter.ExecSqlFunc != nil {
	//		if result, err = parameter.ExecSqlFunc(modifyGetDbQueryOptions(parameter.GetDbQueryOptions(parameter), dataDispos.String), execSql); err != nil {
	//			err = ref.ErrAddPrintf(event, err)
	//			return
	//		}
	//	}
	//default:
	//	result.Result = parameter.Options.Scn
	//	return
	//}
	//return
	var event = "[Position]"
	defer func() {err = ref.RecoverPanic(event, recover())}()
	var _, table = parDef.GetExecFuncParameterValueBase(ctx)
	select {
	case <-ctx.Done():
		err = ctx.Err()
		return
	default:
		switch scn := parDef.GetParameterValueAnyToString(parDef.GetFuncParameterValue(ctx,"position"));scn {
		case "auto":
			//if result,err = sqlExec(getSubSqlExecFuncParameterValue(ctx,event, dataDispos.String, positionSysObjectView, getFullTableScnSql));err != nil{
			//	return
			//}
			return parDef.ResultExec(parDef.NewGetExternalExecFuncParameterValue(ctx, event, result, result.Result, table))
		default:
			result.Result = scn
			return
		}
	}
}
